<p>对类和接口必须要有注释</p>
<p>以下Javadoc元素是必需的：</p> 
<ul> 
  <li>参数，使用<code> @param parameterName </code>。
  </li> <li>方法返回值，使用<code> @返回</code>。</li>
  <li>通用类型，使用<code> @param </code>。</li>
</ul>
<p>此规则不考虑以下公共方法和构造函数：</p>
<ul>
<li> getter和setters。</li>
  <li>带有@Override批注的方法。</li>
  <li>空构造函数。</li>
  <li>静态常量。</li>
</ul>
<h2>不规范的代码示例</h2>

<pre>
/**
  * This is a Javadoc comment
  */
public class MyClass&lt;T&gt; implements Runnable {    // Noncompliant - missing '@param &lt;T&gt;'

  public static final DEFAULT_STATUS = 0;    // Compliant - static constant
  private int status;                           // Compliant - not public

  public String message;                  // Noncompliant

  public MyClass() {                         // Noncompliant - missing documentation
    this.status = DEFAULT_STATUS;
  }

  public void setStatus(int status) {  // Compliant - setter
    this.status = status;
  }

  @Override
  public void run() {                          // Compliant - has @Override annotation
  }

  protected void doSomething() {    // Compliant - not public
  }

  public void doSomething2(int value) {  // Noncompliant
  }

  public int doSomething3(int value) {  // Noncompliant
    return value;
  }
}
</pre>
<h2>正确的代码样例</h2>

<pre>
/**
  * This is a Javadoc comment
  * @param &lt;T&gt; ...
  */
public class MyClass&lt;T&gt; implements Runnable {

  public static final DEFAULT_STATUS = 0;
  private int status;

  /**
    * This is a Javadoc comment
    */
  public String message;

  /**
   * Class comment...
   */
  public MyClass() {
    this.status = DEFAULT_STATUS;
  }

  public void setStatus(int status) {
    this.status = status;
  }

  @Override
  public void run() {
  }

  protected void doSomething() {
  }

  /**
    * @param value ...
    */
  public void doSomething(int value) {

  /**
    *  {@inheritDoc}
    */
  public int doSomething(int value) {
    return value;
  }
}
</pre>

